<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta name="renderer" content="webkit">
		<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
		<!-- Font Awesome -->
		<!-- Ionicons -->
		<!-- Theme style -->
		<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
		<!-- AdminLTE Skins. Choose a skin from the css/skins
		       folder instead of downloading all of them to reduce the load. -->
		<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
		<title></title>
		<style>
			p,
			body {
				margin: 0;
			}
			
			p {
				font-size: .27rem;
				letter-spacing: 1px;
			}
			
			.content {
				margin: 0 .3rem;
				/*background-color: #ccc;*/
				/*height:5rem;*/
			}
			
			label {
				line-height: 34px;
				margin: 0;
				font-weight: normal;
				text-indent: 15px;
			}
			
			input.form-control,
			input.form-control:disabled {
				border: none;
				background-color: rgba(0, 0, 0, 0);
			}
			
			.form-group {
				padding-bottom: 10px;
				border-bottom: 1px solid #ccc;
			}
			
			.form-group .col-xs-3,
			.form-group .col-xs-4,
			.form-group .col-xs-5,
			.form-group .col-xs-6,
			.form-group .col-xs-9 {
				padding: 0;
			}
			
			.topRight {
				display: none;
				position: fixed;
				top: 0px;
				right: 10px;
				width: 135px;
				height: 66px;
				line-height: 18px;
				padding: 20px 10px 10px;
				background: url(img/topright.png);
				background-size: 100% 100%;
				color: #fff;
			}
			
			.btn {
				font-size: 15px;
				line-height: 35px;
				color: #fff;
				background-color: #E0BF6C;
			}
			
			.control-label {
				font-size: 12px;
			}
			
			input.form-control {
				font-size: 12px;
			}
		</style>
		<script>
			window.onload = function() {
				getRem(720, 100)
			};
			window.onresize = function() {
				getRem(720, 100)
			};

			function getRem(pwidth, prem) {
				var html = document.getElementsByTagName("html")[0];
				var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
				html.style.fontSize = oWidth / pwidth * prem + "px";
			}
		</script>
		<script src="bower_components/jquery/dist/jquery.min.js"></script>
	</head>

	<body>
		<input type="hidden" id="url"/>
		<input type="hidden" id="type"/>
		<div class="content">
			<div class="topRight">请点击右上方选择“浏览器打开”</div>
			<div style="width:60%;margin:1.2rem auto;">
				<img src="img/phone.png" alt="" style="width:100%" />
			</div>
			<div style="width:60%;margin:0 auto;">
				<button type="button" class="btn btn-default btn-block" id="download">立即下载</button>
			</div>

		</div>
		<script type="text/javascript" src="js/argument.js"></script>
		<script type="text/javascript">
			console.log(phoneSystem());
			$.ajax({
					type: "post",
					url: url + "GetAppDownload",
					async: true,
					contentType: "application/x-www-form-urlencoded",
					dataType: 'json',
					success:function(res){
						if(res.status == 1000||res.status == 102) {
							ToLogin(res)
						} else if(res.status == 1) {
							$("#url").val(res.data[phoneSystem()].url);
							$("#type").val(isWeiXin());
						}else{
							alert(res.error);
						}
					}
				})
			
			function isWeiXin(){
			    var ua = window.navigator.userAgent.toLowerCase();
			    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
			        return true;
			    }else{
			        return false;
			    }
			}
			function phoneSystem() {
				var phone = ""
				var u = navigator.userAgent,
					app = navigator.appVersion;
				var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
				var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
				if(isAndroid) {
					//这个是安卓操作系统
					phone = "android";
				}
				if(isIOS) {　　　 //这个是ios操作系统
					phone = "ios";
				}
				return phone;
			}
			$(function() {
				$("#download").click(function() {
					console.log($("#type").val())
					if($("#type").val() == 'true'){
						$(".topRight").show();
					}else{
						window.location.href = $("#url").val();
					}
				})
				
				$(".topRight").click(function(){
					$(this).hide()
				})
			})
			
			
		</script>
	</body>

</html>